package Q1;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String str = scanner.next();
        int len = str.length();
        Map<Character, Boolean> map = new HashMap<>();

        StringBuilder ret = new StringBuilder();

        for (int i = len - 1; i >= 0; i--) {
            if (!map.containsKey(str.charAt(i))) {
                ret.append(str.charAt(i));
                map.put(str.charAt(i), true);
            }
        }

        System.out.println(ret.toString());
    }
}
